import fly from '../utils/fly.js'
/**
 * 查询会员订单列表
 */
export function getOrderList(params) {
	return fly.get({
		url: `/applet/trade/orders`,
		needToken: true,
		params:params
	})
}
/**
 * 查询订单详情
 */
export function getOrderDetail(order_sn) {
	return fly.get({
		url: `/applet/trade/orders/`+order_sn,
		needToken: true
	})
}
/**
 * 取消订单
 */
export function cancelOrder(order_sn,reason) {
	return fly.request({
		url:'/applet/trade/orders/'+order_sn+'/cancel',
		needToken: true,
		method:'POST',
		params:{
			reason
		}
	})
}
/**
 * 确认收货
 */
export function confrimRog(order_sn) {
	return fly.request({
		url:'/applet/trade/orders/'+order_sn+'/rog',
		needToken: true,
		method:'POST'
	})
}
/**
 *删除订单
 */
export function deleteOrder(order_sn) {
	return fly.request({
		url:'/applet/trade/orders/remove/'+order_sn+'/',
		needToken: true,
		method:'PUT'
	})
}
/**
 * 查询会员订单总条数
 */
export function getOrderStatusNum() {
	return fly.get({
		url: `/applet/trade/orders/status-num`,
		needToken: true
	})
}
/**
 * 查询物流
 */
export function getExpress(params) {
	return fly.get({
		url: `/applet/express`,
		needToken: true,
		params
	})
}
